import { createContext, useState } from 'react';
import { baseConfig } from '../constants';

// createContext用来创建一个上下文对象
export const BaseContext = createContext(null);

const BaseProvider = ({ children }) => {
  const [tasks, setTasks] = useState(baseConfig.list);

  return (
    <BaseContext.Provider value={{ tasks, setTasks }}>
      {children}
    </BaseContext.Provider>
  );
};


export default BaseProvider;
